package cate.game.pvp.championrace.data;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;

import static cate.game.util.GameKit.uid;

@ToString
@Data
public class ChampionRaceRecord {

    public static ChampionRaceRecord of(ChampionRaceSpec spec, String idA, String idB) {
        ChampionRaceRecord record = new ChampionRaceRecord();
        record.setSpec(spec);
        record.setIdA(idA);
        record.setIdB(idB);
        return record;
    }

    @Id
    private String rid = uid();
    private ChampionRaceSpec spec;

    @JsonIgnore
    private volatile boolean isBetRound;

    private String idA;
    private int psA;
    private String idB;
    private int psB;

    private byte index;

    private byte winner;
    private long aPoints;
    private long bPoints;
    private long aPointsChanged;
    private long bPointsChanged;
    private String replayId;
    private long replayId2;
    private long recordTime;
}
